home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11792 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.7 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++
  4. Subject: Re: C/C++ knocks the crap out of Ada
  5. Date: 15 Mar 1996 21:40:40 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4idk8oINNrr2@keats.ugrad.cs.ubc.ca>
  8. References: <00001a73+00002504@msn.com> <4ica32INN5hn@gambier.ugrad.cs.ubc.ca> <4icja9$1r92@saba.info.ucla.edu> <4idh80$6tj@solutions.solon.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4idh80$6tj@solutions.solon.com>,
  12. Peter Seebach <seebs@solutions.solon.com> wrote:
  13.  >In article <4icja9$1r92@saba.info.ucla.edu>,
  14.  >Jay Martin <jmartin@cs.ucla.edu> wrote:
  15.  >>>Lex and Yacc are proven utilities that work. 
  16.  >
  17.  >>Lex and Yacc are braindead crap along with C and Unix.  Do they have an
  18.  >>option to output Ada??
  19.  >
  20.  >Huh?  I'm sorry, but you have *no* argument here.  Lex and Yacc are brilliant;
  21.  >they do *exactly* what they're supposed to do.  What problems do you see
  22.  >with them?  (Reply by email, please, this is even less topical than usual.)
  23.  >
  24.  >Sure they have an option to output Ada.  It's the one you're about to write,
  25.  >if it's so useful.  I have no need for it, so I'm not about to.  It could
  26.  >be done, of course - it's just not currently needed.  :)
  27.  >
  28.  >>You have become and "idiot savant" at it, congratulations,
  29.  >>unfortunately the next guy might not reading your code. I wasn't
  30.  >>talking about needing a grammer, I was talking with about reading in a
  31.  >>simple table.  Its stupid to bring in two tools with two more
  32.  >>"languages" to do something trivial that takes a page of normal code.
  33.  >
  34.  >Very few people would bring in yacc for just reading a table.  I personally
  35.  >would.  My table parser would also support simple expression grammars.  Could
  36.  >you do that in a page of normal code, too?  (Of course you could; you'd
  37.  >use perl, and call eval.)
  38.  
  39. I do too. I recently wrote a configuration file parser for a daemon I
  40. was hired to develop. Right now, it has a brain-dead syntax. However, it is
  41. robust with respect to comments and whitespace and deals with ".." strings,
  42. integer constants and identifiers properly. 
  43.  
  44. I used error productions in the yacc grammar to generate useful, friendly error
  45. messages that pinpoint a problem.
  46.  
  47. I anticipate that the grammar will get more complicated when I add certain
  48. features; the parser/scanner will be a snap to update, compared to having to
  49. understand my own code. :)
  50.  
  51. I didn't want to waste time writing this thing. I wanted a configuration file
  52. facility, NOW! Lex and yacc gave it to me, in minutes. And hey, regular
  53. expressiona and grammars _are_ more fun than switch() statements with numeric
  54. case labels... so punish me for enjoying the ``journey'' for its own sake!
  55. I'm glad I like my work!
  56.  
  57.  >Like all tools, lex and yacc are excellent for some tasks, and useless
  58.  >for others.  I can only assume you've been trying to use them for
  59.  >inappropriate tasks, or more likely, that you haven't ever used them,
  60.  >and that you're not familiar with C, either.  You've posted many
  61.  >claims, with *no* documentation, *no* examples, and *no* rationale.
  62.  
  63. That trick allows an author to retreat infinitely without admitting he is
  64. wrong, because there is no wall to back into.  ``But I never said this or
  65. that...''. Of course not. Didn't say a damn thing, in fact.  Without the
  66. documentation, examples and whatnot, it is just *.advocacy fluff.
  67.  
  68.  >Most Ada advocates at least have points to make; you, sir, are a discredit
  69.  >to Ada users.  Hmph.  "rabid language fanatics" indeed.
  70.  
  71. On the contrary, I don't think he discredits anyone but himself.  I'd hate to
  72. think that someone would consider some random C/UNIX fanatic to be a discredit
  73. to _me_.  (Unless I _am_ that fanatic, of course :).
  74. -- 
  75.  
  76.